<?php echo $this->Html->script('jquery');
echo $this->Html->script('fbplugin');
?>
<h1><?php echo $data['News']['title']?></h1>
<div id="left">
	<p><?php echo $data['News']['description']?></p>
	<center>
		<img src="<?php echo str_replace('/thumb/', '/image/', $data['News']['image'])?>" alt="<?php echo $data['News']['title']?>" />
	</center>
	<p><?php echo $data['News']['content']?></p>  
	<br />
	
	<!-- facebook plugin -->
	<div>
		<div style="float:left;"><g:plusone size="medium" annotation="none"></g:plusone></div>
		<div style="float:left;margin-left:10px;" class="fb-like" data-href="<?php echo $this->Seo->link($ogUrl);?>" data-send="false" data-layout="button_count" data-width="10" data-show-faces="true"></div>
		<div  id="fbfacepile">
			<fb:facepile href="<?php echo $this->Seo->link($ogUrl);?>" width="300" max_rows="1"></fb:facepile>
		</div>
		<div style="clear:both;height:20px;"></div>
		
		
	</div>	
	<br />	
	<div class="fb-comments" data-href="<?php echo $this->Seo->link($ogUrl);?>" data-num-posts="<?php echo $webConfig['fbCommentNop']?>" data-width="550"></div>
	<div id="fb-root"></div>				
	<div style="clear:both;height:20px"></div>
	<!-- ===================== -->                
	<div class="othertip"> 
		<ul id="service_list">
			<?php if(count($news)>0){
			foreach($news as $k=>$v){?>                        	
			<li><a href="<?php echo $this->Seo->link('/'.$v['News']['controller'].'/detail/'.$v['News']['id'].'/'.$locale)?>"><?php echo $v['News']['title']?></a></li>
			<?php }}?>
			<?php if(count($nextNews)>0){
			foreach($nextNews as $k=>$v){?>                        	
			<li><a href="<?php echo $this->Seo->link('/'.$v['News']['controller'].'/detail/'.$v['News']['id'].'/'.$locale)?>"><?php echo $v['News']['title']?></a></li>
			<?php }}?>
			<?php if(count($prevNews)>0){
			foreach($prevNews as $k=>$v){?>                        	
			<li><a href="<?php echo $this->Seo->link('/'.$v['News']['controller'].'/detail/'.$v['News']['id'].'/'.$locale)?>"><?php echo $v['News']['title']?></a></li>
			<?php }}?>
		</ul>	
	</div>					              
</div> 	
      
<div class="cleaner"></div>
					
					
<script type="text/javascript">
//google
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
//facebook
//for fb
var accessToken=0;
var uid=0;
var selfurl='<?php echo $this->Seo->link($ogUrl)?>';
fbplugin.selfurl=selfurl;
fbplugin.saveUserDataUrl='<?php echo $this->Seo->link('/fbs/saveuserdata');?>';
  window.fbAsyncInit = function() {
      FB.init({
        appId      : '494778310568489', // App ID
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
      });

  
      
      FB.getLoginStatus(function(response) {
  		  if (response.status === 'connected') {
  		    // the user is logged in and has authenticated your
  		    // app, and response.authResponse supplies
  		    // the user's ID, a valid access token, a signed
  		    // request, and the time the access token 
  		    // and signed request each expire
  		    fbplugin.uid = response.authResponse.userID;
  		  	fbplugin.accessToken = response.authResponse.accessToken;
  		    //call ajax show user config on this app
  		    $('#fbstatus').load('<?php echo $this->Seo->link('/fbs/loaduserdata');?>'+'/'+fbplugin.uid);
  		    
  		  	
  		  } else if (response.status === 'not_authorized') {
  		    // the user is logged in to Facebook, 
  		    // but has not authenticated your app
    		    document.getElementById('btnRead').style.display='block';
  		  } else {
  		    // the user isn't logged in to Facebook.
  		  }

  		  
  		 });

      

      
    };

   
    (function(d){
        var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        d.getElementsByTagName('head')[0].appendChild(js);
      }(document));
    /*
(function(d, s, id) {
	  var js, fjs = d.getElementsByTagName(s)[0];
	  if (d.getElementById(id)) return;
	  js = d.createElement(s); js.id = id;
	  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
	  fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));*/
function postRead()
{
	fbplugin.getPermission('publish_actions','loaduserdata();');
}
function loaduserdata(){
	$('#fbstatus').load('<?php echo $this->Seo->link('/fbs/loaduserdata');?>'+'/'+fbplugin.uid);
}





function openRecentActivity(){	
	$.fancybox({
			type : 'iframe',
			href: '<?php echo $this->Seo->link('/fbs/getuseractivity')?>'+'/'+fbplugin.uid +'/'+fbplugin.accessToken,
			padding : 5,
			width:500,
			height:500
	});

}


//show join

</script>